using System.Configuration;

namespace SZipHandler
{
    public class ConfigReader
    {
        public string[] Format
        {
            get
            {
                return ConfigurationManager.AppSettings["Format"].Split(',');
            }
        }

        public string Server
        {
            get
            {
                return ConfigurationManager.AppSettings["Server"];
            }
        }

        public int Port
        {
            get
            {
                int i = 0;
                int.TryParse(ConfigurationManager.AppSettings["Port"], out i);
                return i;
            }
        }

        public string User
        {
            get
            {
                return ConfigurationManager.AppSettings["User"];
            }
        }

        public string Password
        {
            get
            {
                return ConfigurationManager.AppSettings["Password"];
            }
        }

        public string DownloadFolderPropKey
        {
            get
            {
                return ConfigurationManager.AppSettings["DownloadFolderPropKey"];
            }
        }

        public string LogPath
        {
            get
            {
                return ConfigurationManager.AppSettings["LogPath"];
            }
        }

        public int SleepInSec
        {
            get
            {
                int i = 1;
                int.TryParse(ConfigurationManager.AppSettings["SleepInSec"], out i);
                return i;
            }
        }

        public string ExePath
        {
            get
            {
                return ConfigurationManager.AppSettings["ExePath"];
            }
        }

        public string MemoryFilePath
        {
            get
            {
                return ConfigurationManager.AppSettings["MemoryFilePath"];
            }
        }

        public string[] LoggingStatus
        {
            get
            {
                return ConfigurationManager.AppSettings["LoggingStatus"].Split(',');
            }
        }
    }
}